using System;
using System.ComponentModel;
using System.Linq;

using Newtonsoft.Json;
using Newtonsoft.Json.Linq;

namespace ApiTest.Entitys
{
    /// <summary>
    /// 商品关键词
    /// </summary>  
    /// <remarks>
    /// <![CDATA[ENGINE=InnoDB  COMMENT='商品关键词']]>
    /// </remarks>
    [DbSource("Default"), Serializable]
    public class GoodsKeyword
    {
        /// <summary>
        /// key_id
        /// </summary>
        /// <remarks>
        /// <![CDATA[int NOT NULL COMMENT '']]>
        /// </remarks>
        [Primary]
        public int KeyId { get; set; }

        [JsonConverter(typeof(AutoEnumConverter))]
        public KeyTypeEnum KeyTypeName => (KeyTypeEnum)KeyType;

        /// <summary>
        /// 关键词类型 【类型，品牌，属性】
        /// </summary>
        /// <remarks>
        /// <![CDATA[int NOT NULL COMMENT '关键词类型 【类型，品牌，属性】']]>
        /// </remarks>
        [Column(false)]
        [DisplayName("关键词类型")]
        public int KeyType { get; set; }

        /// <summary>
        /// 关键字
        /// </summary>
        /// <remarks>
        /// <![CDATA[varchar(32) DEFAULT NULL COMMENT '关键字']]>
        /// </remarks>
        [Column(32)]
        [DisplayName("关键字")]
        public string KeyName { get; set; }

        /// <summary>
        /// 关键词组
        /// </summary>
        /// <remarks>
        /// <![CDATA[varchar(255) DEFAULT NULL COMMENT '关键词组']]>
        /// </remarks>
        [Column(255)]
        [DisplayName("关键词组")]
        public string Keys { get; set; }

    }
}
